package com.yc.so;

import com.yc.so.bin.SoBoundsConfigurator;
import com.yc.so.utils.BoundsCalculationUtil;
import com.yc.so.view.SoView;
import com.yc.so.view.impl.DataDisplayView;
import com.yc.so.view.impl.MainPaneView;
import com.yc.so.view.impl.SearchView;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

public class App extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage stage) {
        SoView paneView=new MainPaneView();
        SoView searchView=new SearchView();
        SoView dataDisplayView=new DataDisplayView();
        AnchorPane pane = paneView.getView();
        pane.getChildren().addAll(searchView.getView(),dataDisplayView.getView());
        Scene scene=new Scene(pane);
        scene.setFill(null);
        stage.setScene(scene);
        stage.initStyle(StageStyle.TRANSPARENT);
        SoBoundsConfigurator bounds = BoundsCalculationUtil.getMainPanelBounds();
        System.out.println(bounds);
        stage.setWidth(bounds.getWidth());
        stage.setHeight(bounds.getHeight());
        stage.setX(bounds.getX());
        stage.setY(bounds.getY());
        stage.show();
    }
}
